package com.example.activity.service;

import com.example.activity.so.acvitivi.DeployInfoSO;
import com.example.activity.vo.acvitivi.DeployInfoVO;
import com.example.activity.vo.acvitivi.DeployedVO;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.runtime.ProcessInstance;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

public interface ProcessService {
    /**
     * 部署流程
     */
    Deployment deployment();

    /**
     * 查询部署列表
     *
     * @param deployInfoSO
     * @return
     */
    List<DeployedVO> deployedList(DeployInfoSO deployInfoSO);

    /**
     * 启动流程实例
     *
     * @param account
     * @return
     */
    ProcessInstance startProcess(String account);

    /**
     * 保存工作流配置信息
     *
     * @param deployInfoVO 文件信息
     * @return DeployInfoVO
     */
    DeployInfoVO saveDeployInfo(DeployInfoVO deployInfoVO);

    /**
     * 部署流程
     *
     * @param deployInfoIdList DeployInfoVO
     * @return List<DeployInfoVO>
     */
    List<DeployInfoVO> deploy(List<Long> deployInfoIdList);

    /**
     * 删除流程部署信息
     *
     * @param deployInfoIdList 主键集合
     * @return true删除成功，false删除失败
     */
    Boolean deleteDeploy(List<Long> deployInfoIdList);

    /**
     * 下载部署文件流
     *
     * @param fileId   文件id
     * @param response 响应流
     */
    void downloadDeployFileStream(Long fileId, HttpServletResponse response);
}
